Skip to content

Conversation

@ritwik-g
Copy link
Contributor

Related Issues

Part of #4

Changes Made

  • Added JSON schema validation in HelmValuesConfig.from_dict
  • Created test_schema_validation.py with comprehensive tests for:
    • Valid configuration loading
    • Invalid configuration detection
    • Error message clarity
  • Updated schema to handle auth configuration validation
  • Improved error messages for validation failures
  • Updated tasks.md to reflect completed schema validation tasks

Testing Done

  • Added unit tests
    • Added test_schema_validation.py with test cases for:
      • Minimal valid config
      • Full valid config
      • Default values
      • Type coercion
      • Missing required fields
      • Invalid version
      • Invalid backend type
      • Invalid auth config
      • Invalid path format
  • Manually tested
  • Updated test documentation

Checklist

  • I have read the CONTRIBUTING guidelines
  • My code follows the project's style guidelines
  • I have added tests that prove my fix/feature works
  • I have updated the documentation accordingly
  • All new and existing tests passed
  • My commits follow the project's commit message convention

Type of Change

  • Feature
  • Bug Fix
  • Documentation
  • Performance Improvement
  • Code Style Update
  • Refactoring
  • CI/CD
  • Other

Breaking Change

  • No
  • Yes

Additional Information

The schema validation ensures that configuration files are valid before they are used, preventing runtime errors due to invalid configuration. The validation is comprehensive and provides clear error messages to help users fix configuration issues.

- Added JSON schema validation in HelmValuesConfig.from_dict
- Created test_schema_validation.py with comprehensive tests
- Updated tasks.md to reflect completed schema validation tasks
- Improved error messages for validation failures
- Add metadata property to return ConfigMetadata instance
- Update tests to use ConfigMetadata properties directly
- Improve test coverage in test_to_dict_from_dict
- Maintain backward compatibility
1. Replace standard logging module with HelmLogger
2. Make HelmLogger imports consistent
3. Add debug logs for key operations
4. Fix test assertions to match error messages
- Update Value class to support multiple data types
- Modify ValueBackend and SimpleValueBackend to handle new types
- Add test cases for type validation and handling
- Improve docstrings with type information
@sonarqubecloud
Copy link

@ritwik-g ritwik-g merged commit 854041f into main Feb 17, 2025
9 checks passed
@ritwik-g ritwik-g deleted the feature/4-schema-validation branch February 17, 2025 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants